package com.zl.smartmall.library.po;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class EquipmentComment implements Serializable{
	private String id;//评价ID
	private String repair_apply_id;//报修申请单的id
	private String evaluation;//评价内容
	private String operator;//评价人
	private String detail_created_at;//评价时间
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getRepair_apply_id() {
		return repair_apply_id;
	}
	public void setRepair_apply_id(String repair_apply_id) {
		this.repair_apply_id = repair_apply_id;
	}
	public String getEvaluation() {
		return evaluation;
	}
	public void setEvaluation(String evaluation) {
		this.evaluation = evaluation;
	}
	public String getOperator() {
		return operator;
	}
	public void setOperator(String operator) {
		this.operator = operator;
	}
	
	public String getDetail_created_at() {
		return detail_created_at;
	}
	public void setDetail_created_at(String detail_created_at) {
		this.detail_created_at = detail_created_at;
	}
	public static List<EquipmentComment> parse(JSONArray jsonArray)
			throws JSONException {
		List<EquipmentComment> commentlist = new ArrayList<EquipmentComment>();
		for (int i = 0; i < jsonArray.length(); i++) {
			EquipmentComment comment = new EquipmentComment();
			JSONObject jsonObject = jsonArray.getJSONObject(i);
			comment.setId(jsonObject.getString("id"));
			comment.setRepair_apply_id(jsonObject.getString("repair_apply_id"));
			comment.setEvaluation(jsonObject.getString("evaluation"));
			comment.setOperator(jsonObject.getString("operator"));
			comment.setDetail_created_at(jsonObject.getString("detail_created_at"));
			
			commentlist.add(comment);

		}
		return commentlist;
	}

}
